import request from '@/utils/request'

// 获取所有分析结果
export function getAllAnalysis(videoUrl) {
  return request({
    url: '/course/video/analysis/all',
    method: 'get',
    params: { videoUrl }
  })
}

// 获取视频的章节速览
export function getChaptersAnalysis(videoUrl) {
  return request({
    url: '/course/video/analysis/autoChapters',
    method: 'get',
    params: { videoUrl }
  })
}

// 获取视频的要点提炼
export function getMeetingAssistanceAnalysis(videoUrl) {
  return request({
    url: '/course/video/analysis/meetingAssistance',
    method: 'get',
    params: { videoUrl }
  })
}

// 获取视频的PPT提取
export function getPptAnalysis(videoUrl) {
  return request({
    url: '/course/video/analysis/ppt',
    method: 'get',
    params: { videoUrl }
  })
}

// 获取视频的摘要总结，包含思维导图、问答回顾、发言总结
export function getSummarizationAnalysis(videoUrl) {
  return request({
    url: '/course/video/analysis/summarization',
    method: 'get',
    params: { videoUrl }
  })
}

// 获取转录结果
export function getTranscriptAnalysis(videoUrl) {
  return request({
    url: '/course/video/analysis/transcript',
    method: 'get',
    params: { videoUrl }
  })
}

// 创建视频的章节速览分析任务
export function createChaptersAnalysisTask(videoUrl) {
  return request({
    url: '/course/video/analysis/task/autoChapters',
    method: 'get',
    params: { videoUrl }
  })
}

// 创建视频要点提炼分析任务
export function createMeetingAssistanceTask(videoUrl) {
  return request({
    url: '/course/video/analysis/task/meetingAssistance',
    method: 'get',
    params: { videoUrl }
  })
}

// 创建视频PPT提取任务
export function createPptExtractionTask(videoUrl) {
  return request({
    url: '/course/video/analysis/task/pptExtract',
    method: 'get',
    params: { videoUrl }
  })
}

// 创建发言总结分析任务
export function createConversationalSummaryTask(videoUrl) {
  return request({
    url: '/course/video/analysis/task/summarization/conversational',
    method: 'get',
    params: { videoUrl }
  })
}

// 创建视频的思维导图总结分析任务
export function createMindMapSummaryTask(videoUrl) {
  return request({
    url: '/course/video/analysis/task/summarization/mindMap',
    method: 'get',
    params: { videoUrl }
  })
}

// 创建视频问答回顾分析任务
export function createQuestionsAnsweringTask(videoUrl) {
  return request({
    url: '/course/video/analysis/task/summarization/questionsAnswering',
    method: 'get',
    params: { videoUrl }
  })
}

// 查询任务状态
export function getTaskStatus(taskId) {
  return request({
    url: '/course/video/analysis/task/task',
    method: 'get',
    params: { taskId }
  }).then(res => {
    console.log('Task status response:', JSON.stringify(res))
    return res
  })
} 